// app/service/news.ts
import { Service } from 'egg';
import UserModel from '../apiModel/userModel';

export default class NewsService extends Service {
  public async sayHi(_msg: string): Promise<UserModel> {
    let res = await this.ctx.model.User.findOne<UserModel>({ tag_name: _msg });
    // let resAgree = await this.ctx.model.User.aggregate<UserModel>([{$sort: {name: 1}}]);
    // return resAgree;
    return <UserModel>res;
  }
}
